<template>
  <h3>{{ pForm.title }}</h3>
  <div id="section">
    <bForm :data="pForm.data" :instance="pForm" cover="55%">
      <div class="textbutton edit" @click="router.push('suggestSelfList')">
        我的反馈
      </div>
      <el-button @click="onUpdate" type="primary">完成</el-button>
    </bForm>
  </div>
</template>
<script lang="ts" setup>
import bForm from "@/components/public/b_form.vue";
import { SuggestForm } from "@b/index/suggest";
import { useRouter } from "vue-router";
import { ElButton } from "element-plus";

const pForm = new SuggestForm();
const router = useRouter();
pForm.data.step = 0;
const onUpdate = async () => {
  const res = await pForm.updateData({ upload: ["imgs"] });
  if (res) {
    router.push("suggestSelfList");
  }
};
</script>
<style scoped>
.edit {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 0.9em;
}
</style>
